package com.bwie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bwie.mapper.ServiceItemMapper;
import com.bwie.pojo.ServiceItem;
import com.bwie.pojo.ServiceType;
import com.bwie.service.ServiceTypeService;
import com.bwie.mapper.ServiceTypeMapper;
import com.bwie.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lenovo
 * @description 针对表【service_type(服务类型表)】的数据库操作Service实现
 * @createDate 2025-07-11 16:04:07
 */
@Service
public class ServiceTypeServiceImpl extends ServiceImpl<ServiceTypeMapper, ServiceType>
        implements ServiceTypeService {


    @Autowired
    ServiceTypeMapper serviceTypeMapper;

    @Autowired
    ServiceItemMapper serviceItemMapper;


    @Override
    public R getItemByTypeId(Integer typeId) {

        QueryWrapper<ServiceItem> wrapper = new QueryWrapper<>();

        if (typeId == 1) {
            wrapper.lambda().eq(ServiceItem::getServiceTypeId, typeId);
        } else if (typeId == 2) {
            wrapper.lambda().eq(ServiceItem::getServiceTypeId, typeId);
        } else if (typeId == 3) {
            wrapper.lambda().eq(ServiceItem::getServiceTypeId, typeId);
        } else if (typeId == 4) {
            wrapper.lambda().eq(ServiceItem::getServiceTypeId, typeId);
        } else if (typeId == 5) {
            wrapper.lambda().eq(ServiceItem::getServiceTypeId, typeId);
        }
        //查询
        List<ServiceItem> list = serviceItemMapper.selectList(wrapper);

        return R.OK(list);
    }
}




